<!DOCTYPE html>
<html lang="en">
<head th:include="certificateWeb/headFoot :: headerCss">
</head>
<link rel="stylesheet" href="/css/certificateWeb/workNews/workNews.css">
<body id="body">
<div th:include="certificateWeb/headFoot :: header"></div>
<main id="main">
    <section class="sec_1">
        <div class="div_1">
            <ul>
                <li><a href="/certificate/my">个人信息</a></li>
                <li><a href="/certificate/isResume">我的简历</a></li>
                <!-- <li><a href="/certificate/findApplyExam">报名记录</a></li> -->
                <li><a href="/certificate/infoRecordList">表单提交记录</a></li>
                <li><a href="/certificate/expertRecordList">专家申请记录</a></li>
                <li><a href="/certificate/stationRecordList">考核站点申请记录</a></li>
                <li><a href="/certificate/stationPxRecordList">培训基地申请记录</a></li>
                <li class="this"><a href="/certificate/gradeQuery">成绩查询</a></li>
                 <li><a href="/certificate/message">消息中心</a></li>
                 <li onclick="mock2(this)" data-type="2"><a>幼儿照护初级模拟考试</a></li>
                <li onclick="mock2(this)" data-type="1"><a>幼儿照护中级模拟考试</a></li>
                <li onclick="mock2(this)" data-type="0"><a>幼儿照护高级模拟考试</a></li>
            </ul>
        </div>
        <div class="div_2">
            <label class="label_title">成绩查询</label>
            <hr/>
            <div id="news"></div>
            <div id="page"></div>
        </div>
        <div style="clear: both"></div>
    </section>
</main>
<div th:include="certificateWeb/headFoot :: footer"></div>
</body>
<script type="text/javascript" src="/js/mobile.js"></script>
<script>
    $(function () {
        /*$.ajax({
            url: "/certificate/gradeQueryList",
            type: 'GET',
            data: {
                current: 1,
                number: 8
            },
            success: function (res) {*/

        ajaxToken("/jzApi/user/selAchievementList", "GET", {
            type: 1,
            state: '',
            current: 1,
            number: 14
        }, function (res) {

            if (res.pages == 0) {
                $("#news").html('<div class="noData">暂无数据</div>');
            } else {
                var list = res.records;
                var news = '';
                list.forEach(function (item, index) {
                    var a = '';
                    if (item.type == 0) {
                        a = '理论考试'
                    }
                    if (item.type == 1) {
                        a = '技能考试'
                    }
                    if (item.type == 2) {
                        a = '社会实践'
                    }
                    news +=
                        '<div class="my_bg div_01"><div class="span_1" style="flex: 6"><span class="title_1">批次名称：</span><p class="title_2">' + item.cbatchName + '</p></div>' +
                        '<div style="display: flex;justify-content: space-between">' +
                        '<div class="span_1" style="flex: 6"><span class="title_1">考试名称：</span><p class="title_2">' + item.name + '</p></div>' +
                        '<div class="span_1" style="flex: 2"><span class="title_1">考试类型：</span><p class="title_2">' + a + '</p></div>' +
                        '</div>' +
                        '<div style="display: flex;justify-content: space-between">' +
                        '<div class="span_1" style="flex: 6"><span class="title_1">考试总分数：</span><p class="title_2">' + item.totalScore + '分</p></div>' +
                        '<div class="span_1" style="flex: 2"><span class="title_1">考试时间：</span><p class="title_2">' + item.startTime + '</p></div>' +
                        '</div></div>'
                });
                $("#news").html(news);
                page(1, res.pages);
            }

        });
    });

    function page(num, tolPages) {
        $("#page").paging({
            nowPage: Number(num), // 当前页码
            pageNum: Number(tolPages), // 总页码
            buttonNum: 3, //要展示的页码数量
            canJump: 1,// 是否能跳转。0=不显示（默认），1=显示
            showOne: 0,//只有一页时，是否显示。0=不显示,1=显示（默认）
            callback: function (num) { //回调函数
                ajaxToken("/jzApi/user/selAchievementList", "GET", {
                    type: 1,
                    state: '',
                    current: num,
                    number: 14,
                    t: new Date()
                }, function (res) {
                    console.log(res);
                    var list = res.records;
                    var news = '';
                    list.forEach(function (item, index) {
                        var a = '';
                        if (item.type == 0) {
                            a = '理论考试'
                        }
                        if (item.type == 1) {
                            a = '技能考试'
                        }
                        if (item.type == 2) {
                            a = '社会实践'
                        }
                        news +=
                            '<div class="my_bg div_01"><div class="span_1" style="flex: 6"><span class="title_1">批次名称：</span><p class="title_2">' + item.cbatchName + '</p></div>' +
                            '<div style="display: flex;justify-content: space-between">' +
                            '<div class="span_1" style="flex: 6"><span class="title_1">考试名称：</span><p class="title_2">' + item.name + '</p></div>' +
                            '<div class="span_1" style="flex: 2"><span class="title_1">考试类型：</span><p class="title_2">' + a + '</p></div>' +
                            '</div>' +
                            '<div style="display: flex;justify-content: space-between">' +
                            '<div class="span_1" style="flex: 6"><span class="title_1">考试总分数：</span><p class="title_2">' + item.totalScore + '分</p></div>' +
                            '<div class="span_1" style="flex: 2"><span class="title_1">考试时间：</span><p class="title_2">' + item.startTime + '</p></div>' +
                            '</div></div>'
                    });
                    $("#news").html(news)

                });
            }
        });
    }

</script>
<script type="text/javascript" src="/js/xlPaging.js"></script>
</html>